package com.bjpowernode.springboot.controller;

import com.bjpowernode.springboot.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MyController {
    @RequestMapping(value = "/literal")
    public String literal(Model model){
        model.addAttribute("sex",1);
        model.addAttribute("data","springboot data");
        model.addAttribute("flag",true);

        User user01=new User();
        user01.setId(1001);
        user01.setUsername("lisi");

        User user02=new User();

        model.addAttribute("user01",user01);
        model.addAttribute("user02",user02);
        return "literal";
    }

    @RequestMapping(value = "/splice")
    public String splice(Model model){
        model.addAttribute("totalRows",123);
        model.addAttribute("totalPages",13);
        model.addAttribute("currentPage",2);
        return "splice";
    }
}
